package com.yu.task.controller;
import com.yu.task.globalResult.R;
import com.yu.task.pojo.UserBlog;
import com.yu.task.service.UserBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
//userBlog/insertUserBlog
@RequestMapping("/userBlog")
public class UserBlogController {
    @Autowired
    private UserBlogService userBlogService;

    @PostMapping("/insertUserBlog")
    public R insertUserBlog(@RequestBody UserBlog userBlog){
        int i = userBlogService.insertUserBlog(userBlog);
        if(i == 1){
            return R.success();
        }
        return R.failure();
    }
    @PostMapping("/deleteUserById")
    public R deleteUserBlogByBlogId(@RequestParam Long bid,Long uid){
        int i = userBlogService.deleteUserBlogById(bid,uid);
        if(i == 1){
            return R.success();
        }
        return R.failure();
    }



}
